import React, { Component } from 'react';
import { hot } from 'react-hot-loader';
import {
  // BrowserRouter as Router,
  HashRouter as Router,
  Route,
  Switch,
  Link,
} from 'react-router-dom';
import { Provider } from 'react-redux';

import AAADemo from 'pages/AAADemo';
import Home from 'pages/Home';
import Counter from 'pages/Counter';

import store from '../redux/store';

class App extends Component {
  componentDidMount() {
  }

  render() {
    return (
      <Provider store={store}>
        <Router>
          <div>
            <ul>
              <li><Link to="/">首页</Link></li>
              <li><Link to="/AAADemo">AAADemo</Link></li>
              <li><Link to="/Counter">Counter</Link></li>
            </ul>
            <Switch>
              <Route exact path="/" component={Home} />
              <Route path="/AAADemo" component={AAADemo} />
              <Route path="/Counter" component={Counter} />
            </Switch>
          </div>
        </Router>
      </Provider>
    );
  }
}

export default hot(module)(App);
